package com.glory.erp.invoice.operdetail.bean;

import java.util.HashMap;
import java.util.Map;

import com.glory.erp.auth.emp.bean.Emp;
import com.glory.erp.invoice.goods.bean.Goods;
import com.glory.erp.invoice.store.bean.Store;
import com.glory.erp.util.FormatUtil;

/**
 * @Description: 操作记录（日志）
 * @Title: OperDetail.java
 * @Author: 樊双峰
 * @Date: 2018年6月9日 下午3:55:48
 * @Version V1.0
 */
public class OperDetail {

	public static final Integer OPER_TYPE_OF_IN = 1;
	public static final Integer OPER_TYPE_OF_OUT = 2;

	public static final String OPER_TYPE_OF_IN_VIEW = "入库";
	public static final String OPER_TYPE_OF_OUT_VIEW = "出库";
	
	public static final Map<Integer, String> typeMap = new HashMap<Integer, String>();
	static {
		typeMap.put(OPER_TYPE_OF_IN, OPER_TYPE_OF_IN_VIEW);
		typeMap.put(OPER_TYPE_OF_OUT, OPER_TYPE_OF_OUT_VIEW);
	}
	
	/**
	 * id
	 */
	private Long uuid;
	
	/**
	 * 数量
	 */
	private Integer num;
	
	/**
	 * 操作时间
	 */
	private Long operTime;
	
	/**
	 * 操作时间 视图值
	 */
	private String operTimeView;
	
	/**
	 * 操作类型（入库/出库）
	 */
	private Integer type;
	
	/**
	 * 操作类型 视图值
	 */
	private String typeView;
	
	/**
	 * 操作人
	 */
	private Emp emp;
	
	/**
	 * 商品
	 */
	private Goods goods;
	
	/**
	 * 仓库
	 */
	private Store store;

	public OperDetail() {
	}

	public Long getUuid() {
		return uuid;
	}

	public void setUuid(Long uuid) {
		this.uuid = uuid;
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	public Long getOperTime() {
		return operTime;
	}

	public void setOperTime(Long operTime) {
		this.operTime = operTime;
		this.operTimeView = FormatUtil.formatDate(operTime);
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
		this.typeView = typeMap.get(type);
	}

	public Emp getEmp() {
		return emp;
	}

	public void setEmp(Emp emp) {
		this.emp = emp;
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	public String getOperTimeView() {
		return operTimeView;
	}

	public String getTypeView() {
		return typeView;
	}
}